<template>
	<div class="order-list-item">
		<template v-if="dataset.length == 1">
			<order-item-base v-for="(item, index) in dataset"
                :status="item.status" :title="item.title" :time="type == 'shop' ? item.time : ''"
                :weight="item.weight ? item.weight : ''" :number="item.number ? item.number : ''" :unit="item.unit ? item.unit : ''"
                :key="index" :price="item.price" :isbaozhi="item.isbaozhi"
                class="el-mt-15"
            />
		</template>
		<template v-else>
			<template v-for="(item, index) in dataset">
				<order-item-base v-if="index == 0 && item.weight" :title="item.title" :time="type == 'shop'?item.time:''" :price="item.price" :status="item.status" :weight="item.weight ? item.weight : ''" :number="item.number ? item.number : ''" :key="index" :isbaozhi="item.isbaozhi" :unit="item.unit ? item.unit : ''" :class="{'el-mt-10': true, 'oli-item': stylePlan}" />
				<order-item-base v-else :title="item.title" :price="item.price" :status="item.status" :weight="item.weight ? item.weight : ''" :number="item.number ? item.number : ''" :key="index" :isbaozhi="item.isbaozhi" :unit="item.unit ? item.unit : ''" :class="{'el-mt-15': true, 'oli-item': stylePlan}" />
			</template>
		</template>
	</div>
</template>

<script>
	import OrderItemBase from './base.vue';

	export default {
		components: {
			OrderItemBase
		},
		props: ['ibase', 'dataset', 'type'],
		computed: {
			stylePlan() {
				return this.ibase.style ? true : false;
			}
		},
	}
</script>

<style lang="scss" scoped>
	.order-list-item {

        .oli-item {
            padding-bottom: 1rem;
            border-bottom: 0.1rem solid #eeeeee;
        }

		.all-price {
			text-align: right;
		}
    }
</style>
